﻿using System;
using System.Collections.Generic;

namespace MyHomeworkWebAPi.Models.ef;

public partial class Comment
{
    /// <summary>
    /// 评论ID
    /// </summary>
    public Guid CommentId { get; set; }

    /// <summary>
    /// 用户ID
    /// </summary>
    public Guid UserId { get; set; }

    /// <summary>
    /// 商品ID
    /// </summary>
    public Guid ProductId { get; set; }

    /// <summary>
    /// 评论内容
    /// </summary>
    public string Content { get; set; } = null!;

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 父评论ID（如果是对评论的回复）
    /// </summary>
    public Guid? ParentCommentId { get; set; }

    /// <summary>
    /// 关联的商品
    /// </summary>
    public virtual Product Product { get; set; } = null!;

    /// <summary>
    /// 父评论
    /// </summary>
    public virtual Comment? ParentComment { get; set; }

    /// <summary>
    /// 子评论列表
    /// </summary>
    public virtual ICollection<Comment> Replies { get; set; } = new List<Comment>();
}
